package com.goods.controller.business;

import com.goods.business.service.ProductCategoryService;
import com.goods.common.response.ResponseBean;
import com.goods.common.vo.business.ProductCategoryTreeNodeVO;
import com.goods.common.vo.business.ProductCategoryVO;
import com.goods.common.vo.system.DepartmentVO;
import com.goods.common.vo.system.PageVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author gjl
 * @create 2021-06-07 14:44
 */
@RestController
@RequestMapping("/business/productCategory")
public class ProductCategoryController {
    @Autowired
    private ProductCategoryService productCategoryService;

    @GetMapping("/categoryTree")
    public ResponseBean<PageVO<ProductCategoryTreeNodeVO>> getList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                                   @RequestParam(value = "pageSize") Integer pageSize,
                                                                   ProductCategoryTreeNodeVO productCategoryTreeNodeVO){
        PageVO<ProductCategoryTreeNodeVO> categoryServiceList = productCategoryService.getList(pageNum, pageSize, productCategoryTreeNodeVO);
        return ResponseBean.success(categoryServiceList);
    }
}
